The expanding and collapsing of menu's works well on the menu item of the active page or superpage. Other menu's expand with an HTTP error 200, and won't collapse anymore.

For example this menu:

  • Create content
    • Page
    • Story
  • Administer
    • Help

If the active page is Page/Story/Create content, the menu 'Create content' expands and collapses fine but the menu Administer expands once with HTTP error 200 and won't collapse anymore. If the active page is Administer or Help, it's the other way around: the menu Administer collapses and expands fine, the menu Create content does not.

CommentFileSizeAuthor
#1 activemenu-jquery-compatability.patch2.17 KBdman

Comments

dman’s picture

Title: Active menu's only work well on active page and subpages » Active menu's : HTTP error 200 and intermittant expansion problems
Version: 5.x-0.8 » master
StatusFileSize
new2.17 KB

I'll submit this patch here - since it's half related and will probably solve this issue.

This patch :
- Removes the 'HTTP 200 error' problem, since 200 is actually just a response, not an error. Something happened in updated versions of jquery to feed back more data, but this extra data is now registering as error messages :-) Easy fix.

- Contains a compatability patch for jquery 1.0, 1.1, 1.2 (they all will work equally) that fixes the problem that upgraders may encounter "unclick() is not a function". unclick was removed in 1.0-1.1 and a backwards compatable alternative is unbind("click")
(I'm upgraded to jquery 1.2 because I'm using the 'interface' library)

- Changes the current code that sets an 'animating' property on the menu item DOM object, and instead sets an 'animating' class. This was neccessary because the code, when passing the object, was passing a copy of the object sometimes (not a handle) and the property was not remaining attached to the real thing.
Behavior before this patch was : Open worked fine, closed worked fine (but didn't unset 'menu.animating'). Attempting to open again failed.
This more open approach also allows you to catch an '.animating' class in css. I use it to set the opacity to 50% just to indicate "Yes, you did click it and something is happening..."

I'm shifting the issue to HEAD - as that's where this patch will apply. Dunno about earlier versions. It looks like the 'version' is for jstools in general, and activemenus in particular seems untouched for a while, so you'll probably be safe.

Please can someone else test on their browser/theme and RTBC it? This fixes my troubles and should be safe across the board, but I'm not going out of my way to test it on a dozen wacky browsers. If I get at least two "OK" votes I'll commit.

gnat’s picture

I am using the 5.x-0.8 version of JStools. I used this patch against the activemenu.js file in that release, and it patched cleanly as well as fixed the 200 error problem that I was hitting.

nedjo’s picture

Status: Active » Fixed

Thanks, I've modified and applied the patch.

dman’s picture

:)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.